package com.qf.service.impl;

import com.qf.mapper.StudentMapper;
import com.qf.pojo.Student;
import com.qf.service.StudentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author zdl
 * @date 2025/2/10
 */
@Service
public class StudentServiceImpl implements StudentService {
    @Resource
    private StudentMapper studentMapper;
    @Override
    public List<Student> findAllStudent() {
        return studentMapper.selectAllStudent();
    }

    @Override
    public Student findStudentById(int id) {
        return studentMapper.selectStudentById(id);
    }

    @Override
    public int updateStudentById(Student student) {
        return studentMapper.updateStudent(student);
    }

    @Override
    public List<Student> findStudentLikeSnameOrClassName(String sname,String className) {
        return studentMapper.selectStudentLikeSnameOrClassName(sname,className);
    }

    @Override
    public int delStudentById(int id) {
        return studentMapper.deleteStudentById(id);
    }
}
